package com.qianbei.view.orm;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.qianbei.view.orm.Course;
import com.qianbei.view.orm.RequestPersistent;
import com.qianbei.view.orm.RFID;

import com.qianbei.view.orm.CourseDao;
import com.qianbei.view.orm.RequestPersistentDao;
import com.qianbei.view.orm.RFIDDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig courseDaoConfig;
    private final DaoConfig requestPersistentDaoConfig;
    private final DaoConfig rFIDDaoConfig;

    private final CourseDao courseDao;
    private final RequestPersistentDao requestPersistentDao;
    private final RFIDDao rFIDDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        courseDaoConfig = daoConfigMap.get(CourseDao.class).clone();
        courseDaoConfig.initIdentityScope(type);

        requestPersistentDaoConfig = daoConfigMap.get(RequestPersistentDao.class).clone();
        requestPersistentDaoConfig.initIdentityScope(type);

        rFIDDaoConfig = daoConfigMap.get(RFIDDao.class).clone();
        rFIDDaoConfig.initIdentityScope(type);

        courseDao = new CourseDao(courseDaoConfig, this);
        requestPersistentDao = new RequestPersistentDao(requestPersistentDaoConfig, this);
        rFIDDao = new RFIDDao(rFIDDaoConfig, this);

        registerDao(Course.class, courseDao);
        registerDao(RequestPersistent.class, requestPersistentDao);
        registerDao(RFID.class, rFIDDao);
    }
    
    public void clear() {
        courseDaoConfig.clearIdentityScope();
        requestPersistentDaoConfig.clearIdentityScope();
        rFIDDaoConfig.clearIdentityScope();
    }

    public CourseDao getCourseDao() {
        return courseDao;
    }

    public RequestPersistentDao getRequestPersistentDao() {
        return requestPersistentDao;
    }

    public RFIDDao getRFIDDao() {
        return rFIDDao;
    }

}
